/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.repair.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.repair.dto.ElevatorDetailDTO;
import org.springblade.modules.repair.dto.ElevatorQueryDTO;
import org.springblade.modules.repair.dto.SimpleElevatorPlanInfoDTO;
import org.springblade.modules.repair.entity.Elevator;
import org.springblade.modules.repair.vo.*;
import org.springblade.modules.repair.vo.elevator.ElevatorHealthVo;
import org.springblade.modules.repair.vo.elevator.ElevatorPartWorkVo;
import org.springblade.modules.repair.vo.elevator.ElevatorPlanVo;
import org.springblade.modules.system.entity.Dict;

import java.util.List;
import java.util.Map;

/**
 * 电梯信息 服务类
 *
 * @author BladeX
 * @since 2021-05-21
 */
public interface IElevatorService extends BaseService<Elevator> {


	/**
	 * 更新电梯的状态
	 * @param elevator 电梯信息
	 * @return 结果集
	 */
    Boolean update(Elevator elevator);

    List<ListElevatorVO> listElevator(Long buildingId, String elevatorName);

    ElevatorDetailVO selectElevatorDetail(Long elevatorId);

	Boolean updateElevatorDetail(Long id, ElevatorDetailDTO elevatorDetailDTO);

	IPage<ElevatorVO> selectElevatorPage(IPage<ElevatorVO> page, Elevator elevator);

	/**
	 * 更新停梯状态
	 * @param elevatorId
	 * @param isStop
	 * @return
	 */
	Boolean updateElevatorIsStop(Long elevatorId, Integer isStop);

    IPage<ElevatorDetailVO> getElevatorListByUserDid(ElevatorQueryDTO queryDTO, IPage<ElevatorDetailVO> page);

	/**
	 * 根据项目id 查询列表
	 * @param buildingId 项目id
	 * @param page 分页信息
	 * @param eleName
	 * @return 分页结果
	 */
    IPage<ElevatorVO> buildingElevatorList(Long buildingId, IPage<Object> page, String eleName);

    SimpleElevatorPlanInfoDTO getSimpleElevatorPlanInfo(Long elevatorId);

	/**
	 * copy from maintain_admin project, @lasy
	 * @return elevator principal count result map
	 */
	Map<String,Integer> selectElevatorPrincipalCount();

	/**
	 * Elevator overview
	 * @return elevator overview statistics
	 */
	ElevatorPrincipalStatisticsVO selectElevatorOverview();

	/**
	 * Down unset excel
	 * @param unsetType
	 * @return down link
	 */
	String downUnsetExcel(Integer unsetType);

    List<ElevatorSimpleInfoVO> getElevatorSimpleList(List<Long> elevatorIds);

	ElevatorSimpleInfoVO getElevatorSimpleInfo(Long elevatorId);


	/**
	 * 根据电梯id获取整梯档案
	 * @param elevatorId 电梯id
	 * @param partId 部件id
	 * @param floorStandIds 层站id
	 * @return 数据集
	 */
    ElevatorHealthVo getElevatorHealthInfo(Long elevatorId,Long partId, Long floorStandIds);

	/**
	 * 新基础信息详情
	 * @param elevatorId 当前电梯id
	 * @param partId 部件id
	 * @return 结果
	 */
    NewElevatorPartVO getNewElevatorPartVO(Long elevatorId, Long partId);

	/**
	 * 通用部件图片详情页
	 * @param planId 当前工单id
	 * @return 结果
	 */
	ElevatorPartWorkVo getElevatorPartWorkDetailImage(Long planId);

	List<ElevatorPlanVo>  planListByAndWx(Long elevatorId);

	List<Dict> driverModeFieldSelect(String code, String driverModeCode, String driverModeKey);

	/**
	 * 根据电梯id获取电梯类型
	 * @param elevatorId
	 * @return
	 */
	String getModeNameByElevatorId(Long elevatorId);

	/**
	 * 获取项目下的电梯列表
	 * @param buildingId
	 * @return
	 */
	List<ElevatorSimpleInfoVO> getListByBuildingId(Long buildingId);

//	/**
//	 * 获取所有未排期的电梯列表
//	 * @param page
//	 * @param planContentStatisticalSearchDTO 组ID
//	 * @return 数据集
//	 */
//	IPage<PlanContentStatisticalDetailVo> getDisScheduleOfGroupIds(IPage<PlanContentStatisticalDetailVo> page, PlanContentStatisticalSearchDTO planContentStatisticalSearchDTO);
}
